package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Tag;
import cn.wolfcode.trip.base.mapper.TagMapper;
import cn.wolfcode.trip.base.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TagServiceImpl implements ITagService {
    @Autowired
    private TagMapper tagMapper;
    @Override
    public List<Tag> listAll() {
        return tagMapper.selectAll();
    }

    @Override
    public List<Tag> queryTagForStrategyByStrategyId(Long strategyId) {
        return tagMapper.queryTagForStrategyByStrategyId(strategyId);
    }

    @Override
    public void insertRelation(Long id, Long tagId) {
        tagMapper.insertRelation(id,tagId);
    }

    @Override
    public void deleteRelation(Long strategyId, Long tagId) {
        tagMapper.deleteRelation(strategyId,tagId);
    }
}
